<template>
  <div>
    <!-- 头部导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/welcome' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb>

    <el-card class="box-card">
      <!-- 表单是model 表格是data  border横向边框 stripe隔行换色-->
      <el-table :data="rightsList" border stripe>
        <el-table-column type="index"></el-table-column>
        <el-table-column label="权限名称" prop="authName"></el-table-column>
        <el-table-column label="路径" prop="path"></el-table-column>
        <el-table-column label="权限等级" prop="level"></el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      rightsList: []
    };
  },

  methods: {
    // 获取权限列表
    async getRights() {
      var res = await this.axios.get("rights/list");
      console.log(res);
      if (res.meta.status == 200) {
        this.rightsList = res.data;
      }
      console.log(this.rightsList);
    }
  },

  created() {
    this.getRights();
  }
};
</script>

<style lang='less' scoped>
</style>
